package org.hot100_6.leetcode24;

import org.algorithm.List.ListNode;

public class Solution {
    public ListNode swapPairs(ListNode head) {

        if (head==null || head.next ==null){
            return head;
        }

        ListNode temp  = new ListNode(-1);

        temp = head.next;

        head.next = swapPairs(temp.next);

        temp.next = head;

        return temp;
    }
}
